Conversation
Codecov Report
@@ Coverage Diff @@
## master #8253 +/- ##
=======================================
Coverage 65.68% 65.68%
=======================================
Files 481 481
Lines 23348 23348
Branches 2572 2572
=======================================
Hits 15335 15335
Misses 7875 7875
Partials 138 138
Continue to review full report at Codecov.
|
|
what are the cases where they would not be the same type? is that suggestive of a bigger issue? otherwise, LGTM |
@DiggidyDave, we're casting the results from the DB — a list of tuples — into a Numpy array so we can address each column efficiently: >>> data = [("a", 1), ("b", 10)]
>>> np.array(data)
array([['a', '1'],
['b', '10']], dtype='<U2')
>>> np.array(data)[:,0] # first column
array(['a', 'b'], dtype='<U2')
>>> np.array(data)[:,1] # second column
array(['1', '10'], dtype='<U2')Note that the numbers were cast to unicode, since that's the common type between int and unicode. If we use "object", though: >>> np.array(data, dtype='object')
array([['a', 1],
['b', 10]], dtype=object) |
CATEGORY
Choose one
SUMMARY
The fix introduced in #8226 is not working for some types. We have a query returning the following error:
This happens because before creating the Pandas dataframe we cast the data into a Numpy array, and Numpy is casting all columns to the same type. I fixed it by keeping the dtype as "object".
TEST PLAN
Query now runs successfully.
ADDITIONAL INFORMATION
REVIEWERS
@khtruong